<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="language" content="en" />
        <link href="./assets/ffd55088/css/bootstrap.css" rel="stylesheet">
<link href="./assets/5cf9384a/solarized_light.css" rel="stylesheet">
<link href="./assets/6c54116e/style.css" rel="stylesheet">
<script src="./assets/a44cef0f/jquery.js"></script>
<script src="./assets/ffd55088/js/bootstrap.js"></script>
<script src="./assets/8ac4e28a/jssearch.js"></script>    <title>BaseImage, yii\imagine\BaseImage - Yii Framework 2.0 API Documentation</title>
</head>
<body>

<div class="wrap">
    <nav id="w10545" class="navbar-inverse navbar-fixed-top navbar" role="navigation"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#w10545-collapse"><span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span></button><a class="navbar-brand" href="./index.html">Yii Framework 2.0 API Documentation</a></div><div id="w10545-collapse" class="collapse navbar-collapse"><ul id="w10546" class="navbar-nav nav"><li><a href="./index.html">Class reference</a></li>
<li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown">Extensions <b class="caret"></b></a><ul id="w10547" class="dropdown-menu"><li><a href="./ext-apidoc-index.html" tabindex="-1">apidoc</a></li>
<li><a href="./ext-authclient-index.html" tabindex="-1">authclient</a></li>
<li><a href="./ext-bootstrap-index.html" tabindex="-1">bootstrap</a></li>
<li><a href="./ext-codeception-index.html" tabindex="-1">codeception</a></li>
<li><a href="./ext-debug-index.html" tabindex="-1">debug</a></li>
<li><a href="./ext-elasticsearch-index.html" tabindex="-1">elasticsearch</a></li>
<li><a href="./ext-faker-index.html" tabindex="-1">faker</a></li>
<li><a href="./ext-gii-index.html" tabindex="-1">gii</a></li>
<li><a href="./ext-imagine-index.html" tabindex="-1">imagine</a></li>
<li><a href="./ext-jui-index.html" tabindex="-1">jui</a></li>
<li><a href="./ext-mongodb-index.html" tabindex="-1">mongodb</a></li>
<li><a href="./ext-redis-index.html" tabindex="-1">redis</a></li>
<li><a href="./ext-smarty-index.html" tabindex="-1">smarty</a></li>
<li><a href="./ext-sphinx-index.html" tabindex="-1">sphinx</a></li>
<li><a href="./ext-swiftmailer-index.html" tabindex="-1">swiftmailer</a></li>
<li><a href="./ext-twig-index.html" tabindex="-1">twig</a></li></ul></li>
<li><a href="./guide-README.html">Guide</a></li></ul><div class="navbar-form navbar-left" role="search">
  <div class="form-group">
    <input id="searchbox" type="text" class="form-control" placeholder="Search">
  </div>
</div>
</div></nav>
    <div id="search-resultbox" style="display: none;" class="modal-content">
        <ul id="search-results">
        </ul>
    </div>

    
<div class="row">
    <div class="col-md-3">
                <div id="navigation" class="list-group"><a class="list-group-item active" href="#navigation-10544" data-toggle="collapse" data-parent="#navigation">yii\imagine <b class="caret"></b></a><div id="navigation-10544" class="submenu panel-collapse collapse in"><a class="list-group-item active" href="./yii-imagine-baseimage.html">BaseImage</a>
<a class="list-group-item" href="./yii-imagine-image.html">Image</a></div></div>    </div>
    <div class="col-md-9 api-content" role="main">
        <h1>Class yii\imagine\BaseImage</h1>
<div class="top-nav">
    <a href="index.html">All Classes</a>
            | <a href="#properties">Properties</a>
                | <a href="#methods">Methods</a>
                    | <a href="#constants">Constants</a>
    </div>

<table class="summaryTable docClass table table-bordered">
    <colgroup>
        <col class="col-name" />
        <col class="col-value" />
    </colgroup>
            <tr><th>Inheritance</th><td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td></tr>
                            <tr><th>Subclasses</th><td><a href="yii-imagine-image.html">yii\imagine\Image</a></td></tr>
                        <tr><th>Available since version</th><td>2.0</td></tr>
                    <tr>
          <th>Source Code</th>
          <td><a href="https://github.com/yiisoft/yii2-imagine/blob/master/BaseImage.php">https://github.com/yiisoft/yii2-imagine/blob/master/BaseImage.php</a></td>
        </tr>
    </table>

<div class="class-description">
    <p><strong>BaseImage provides concrete implementation for <a href="yii-imagine-image.html">yii\imagine\Image</a>.</strong></p>
    <p>Do not use BaseImage. Use <a href="yii-imagine-image.html">yii\imagine\Image</a> instead.</p>

    </div>

<a id="properties"></a>

<div class="summary doc-property">
<h2>Public Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-property" />
    <col class="col-type" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
        <tr id="$driver">
        <td><a href="yii-imagine-baseimage.html#$driver-detail">$driver</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a>|<a href="http://www.php.net/language.types.string">string</a></td>
        <td>The driver to use.</td>
        <td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td>
    </tr>
            <tr id="$thumbnailBackgroundAlpha">
        <td><a href="yii-imagine-baseimage.html#$thumbnailBackgroundAlpha-detail">$thumbnailBackgroundAlpha</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>Background alpha (transparency) to use when creating thumbnails in <code>ImageInterface::THUMBNAIL_INSET</code>
mode with both width and height specified.</td>
        <td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td>
    </tr>
            <tr id="$thumbnailBackgroundColor">
        <td><a href="yii-imagine-baseimage.html#$thumbnailBackgroundColor-detail">$thumbnailBackgroundColor</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>Background color to use when creating thumbnails in <code>ImageInterface::THUMBNAIL_INSET</code> mode with
both width and height specified.</td>
        <td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td>
    </tr>
    </table>
</div>

<a id="methods"></a>

<div class="summary doc-method">
<h2>Public Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
            <tr id="crop()">
        <td><a href="yii-imagine-baseimage.html#crop()-detail">crop()</a></td>
        <td>Crops an image.</td>
        <td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td>
    </tr>
            <tr id="frame()">
        <td><a href="yii-imagine-baseimage.html#frame()-detail">frame()</a></td>
        <td>Adds a frame around of the image. Please note that the image size will increase by <code>$margin</code> x 2.</td>
        <td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td>
    </tr>
            <tr id="getImagine()">
        <td><a href="yii-imagine-baseimage.html#getImagine()-detail">getImagine()</a></td>
        <td>Returns the <code>Imagine</code> object that supports various image manipulations.</td>
        <td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td>
    </tr>
                <tr id="setImagine()">
        <td><a href="yii-imagine-baseimage.html#setImagine()-detail">setImagine()</a></td>
        <td></td>
        <td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td>
    </tr>
            <tr id="text()">
        <td><a href="yii-imagine-baseimage.html#text()-detail">text()</a></td>
        <td>Draws a text string on an existing image.</td>
        <td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td>
    </tr>
            <tr id="thumbnail()">
        <td><a href="yii-imagine-baseimage.html#thumbnail()-detail">thumbnail()</a></td>
        <td>Creates a thumbnail image.</td>
        <td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td>
    </tr>
            <tr id="watermark()">
        <td><a href="yii-imagine-baseimage.html#watermark()-detail">watermark()</a></td>
        <td>Adds a watermark to an existing image.</td>
        <td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td>
    </tr>
    </table>
</div>

<div class="summary doc-method">
<h2>Protected Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
        <tr id="createImagine()">
        <td><a href="yii-imagine-baseimage.html#createImagine()-detail">createImagine()</a></td>
        <td>Creates an <code>Imagine</code> object based on the specified <a href="yii-imagine-baseimage.html#$driver-detail">$driver</a>.</td>
        <td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td>
    </tr>
                        <tr id="getThumbnailBox()">
        <td><a href="yii-imagine-baseimage.html#getThumbnailBox()-detail">getThumbnailBox()</a></td>
        <td>Returns box for a thumbnail to be created. If one of the dimensions is set to <code>null</code>, another one is calculated
automatically based on width to height ratio of original image box.</td>
        <td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td>
    </tr>
                    </table>
</div>

<a id="events"></a>

<a id="constants"></a>
<div class="summary doc-const">
    <h2>Constants</h2>

    <p><a href="#" class="toggle">Hide inherited constants</a></p>

    <table class="summary-table table table-striped table-bordered table-hover">
    <colgroup>
        <col class="col-const" />
        <col class="col-value" />
        <col class="col-description" />
        <col class="col-defined" />
    </colgroup>
    <tr>
        <th>Constant</th><th>Value</th><th>Description</th><th>Defined By</th>
    </tr>
            <tr id="DRIVER_GD2">
          <td id="DRIVER_GD2-detail">DRIVER_GD2</td>
          <td>'gd2'</td>
          <td>GD2 driver definition for Imagine implementation using the GD library.
</td>
          <td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td>
        </tr>
            <tr id="DRIVER_GMAGICK">
          <td id="DRIVER_GMAGICK-detail">DRIVER_GMAGICK</td>
          <td>'gmagick'</td>
          <td>Gmagick driver definition.
</td>
          <td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td>
        </tr>
            <tr id="DRIVER_IMAGICK">
          <td id="DRIVER_IMAGICK-detail">DRIVER_IMAGICK</td>
          <td>'imagick'</td>
          <td>Imagick driver definition.
</td>
          <td><a href="yii-imagine-baseimage.html">yii\imagine\BaseImage</a></td>
        </tr>
        </table>
</div>

<h2>Property Details</h2>

<div class="property-doc">

    <div class="detail-header h3" id="$driver-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-imagine-baseimage.html#$driver-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-imagine/edit/master/BaseImage.php#L50" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-imagine/blob/master/BaseImage.php#L50" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $driver        <span class="detail-header-tag small">
            public            static                                    property
                    </span>
    </div>

    <div class="doc-description">
        <p>The driver to use. This can be either a single driver name or an array of driver names.
If the latter, the first available driver will be used.</p>

            </div>

    <div class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a>|<a href="http://www.php.net/language.types.string">string</a></span> <a href="yii-imagine-baseimage.html#$driver-detail">$driver</a> <span style="color: #0000BB"></span><span style="color: #007700">=&nbsp;[</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">DRIVER_GMAGICK</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">DRIVER_IMAGICK</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">DRIVER_GD2</span><span style="color: #007700">]</span></div>


    <div class="detail-header h3" id="$thumbnailBackgroundAlpha-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-imagine-baseimage.html#$thumbnailBackgroundAlpha-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-imagine/edit/master/BaseImage.php#L71" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-imagine/blob/master/BaseImage.php#L71" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $thumbnailBackgroundAlpha        <span class="detail-header-tag small">
            public            static                                    property
                            (available since version 2.0.4)
                    </span>
    </div>

    <div class="doc-description">
        <p>Background alpha (transparency) to use when creating thumbnails in <code>ImageInterface::THUMBNAIL_INSET</code>
mode with both width and height specified. Default is solid.</p>

            </div>

    <div class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <a href="yii-imagine-baseimage.html#$thumbnailBackgroundAlpha-detail">$thumbnailBackgroundAlpha</a> <span style="color: #0000BB"></span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">100</span></div>


    <div class="detail-header h3" id="$thumbnailBackgroundColor-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-imagine-baseimage.html#$thumbnailBackgroundColor-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-imagine/edit/master/BaseImage.php#L63" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-imagine/blob/master/BaseImage.php#L63" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $thumbnailBackgroundColor        <span class="detail-header-tag small">
            public            static                                    property
                            (available since version 2.0.4)
                    </span>
    </div>

    <div class="doc-description">
        <p>Background color to use when creating thumbnails in <code>ImageInterface::THUMBNAIL_INSET</code> mode with
both width and height specified. Default is white.</p>

            </div>

    <div class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <a href="yii-imagine-baseimage.html#$thumbnailBackgroundColor-detail">$thumbnailBackgroundColor</a> <span style="color: #0000BB"></span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'FFF'</span></div>

</div>
<h2>Method Details</h2>

<div class="method-doc">

    <div class="detail-header h3" id="createImagine()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-imagine-baseimage.html#createImagine()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-imagine/edit/master/BaseImage.php#L99" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-imagine/blob/master/BaseImage.php#L99" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        createImagine()
        <span class="detail-header-tag small">
            protected                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Creates an <code>Imagine</code> object based on the specified <a href="yii-imagine-baseimage.html#$driver-detail">$driver</a>.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">protected static</span> <span class="signature-type">\Imagine\Image\ImagineInterface</span> <strong><a href="yii-imagine-baseimage.html#createImagine()-detail">createImagine</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">\Imagine\Image\ImagineInterface</td>
                  <td class="param-desc-col"><p>The new <code>Imagine</code> object</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidconfigexception.html">yii\base\InvalidConfigException</a></td>
                  <td class="param-desc-col"><p>if <a href="yii-imagine-baseimage.html#$driver-detail">$driver</a> is unknown or the system doesn't support any <a href="yii-imagine-baseimage.html#$driver-detail">$driver</a>.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="crop()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-imagine-baseimage.html#crop()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-imagine/edit/master/BaseImage.php#L144" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-imagine/blob/master/BaseImage.php#L144" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        crop()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Crops an image.</strong></p>

        <p>For example,</p>
<pre><code class="hljs php"><span class="hljs-variable">$obj</span>-&gt;crop(<span class="hljs-string">'path\to\image.jpg'</span>, <span class="hljs-number">200</span>, <span class="hljs-number">200</span>, [<span class="hljs-number">5</span>, <span class="hljs-number">5</span>]);

<span class="hljs-variable">$point</span> = <span class="hljs-keyword">new</span> \Imagine\Image\Point(<span class="hljs-number">5</span>, <span class="hljs-number">5</span>);
<span class="hljs-variable">$obj</span>-&gt;crop(<span class="hljs-string">'path\to\image.jpg'</span>, <span class="hljs-number">200</span>, <span class="hljs-number">200</span>, <span class="hljs-variable">$point</span>);
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type">\Imagine\Image\ImageInterface</span> <strong><a href="yii-imagine-baseimage.html#crop()-detail">crop</a></strong> ( <span style="color: #0000BB">$filename</span>, <span style="color: #0000BB">$width</span>, <span style="color: #0000BB">$height</span>, <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <span style="color: #0000BB">$start&nbsp;</span><span style="color: #007700">=&nbsp;[</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$filename</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The image file path or path alias.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$width</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>The crop width</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$height</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>The crop height</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$start</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The starting point. This must be an array with two elements representing <code>x</code> and <code>y</code> coordinates.</p>
</td>
                </tr>
                                                    <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidparamexception.html">yii\base\InvalidParamException</a></td>
                  <td class="param-desc-col"><p>if the <code>$start</code> parameter is invalid</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="frame()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-imagine-baseimage.html#frame()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-imagine/edit/master/BaseImage.php#L273" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-imagine/blob/master/BaseImage.php#L273" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        frame()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Adds a frame around of the image. Please note that the image size will increase by <code>$margin</code> x 2.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type">\Imagine\Image\ImageInterface</span> <strong><a href="yii-imagine-baseimage.html#frame()-detail">frame</a></strong> ( <span style="color: #0000BB">$filename</span>, <span style="color: #0000BB">$margin&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">20</span>, <span style="color: #0000BB">$color&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'666'</span>, <span style="color: #0000BB">$alpha&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">100</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$filename</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The full path to the image file</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$margin</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>The frame size to add around the image</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$color</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The frame color</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$alpha</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>The alpha value of the frame.</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="getImagine()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-imagine-baseimage.html#getImagine()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-imagine/edit/master/BaseImage.php#L77" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-imagine/blob/master/BaseImage.php#L77" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getImagine()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the <code>Imagine</code> object that supports various image manipulations.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type">\Imagine\Image\ImagineInterface</span> <strong><a href="yii-imagine-baseimage.html#getImagine()-detail">getImagine</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">\Imagine\Image\ImagineInterface</td>
                  <td class="param-desc-col"><p>The <code>Imagine</code> object</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getThumbnailBox()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-imagine-baseimage.html#getThumbnailBox()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-imagine/edit/master/BaseImage.php#L302" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-imagine/blob/master/BaseImage.php#L302" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getThumbnailBox()
        <span class="detail-header-tag small">
            protected                        static            method
                            (available since version 2.0.4)
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns box for a thumbnail to be created. If one of the dimensions is set to <code>null</code>, another one is calculated
automatically based on width to height ratio of original image box.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">protected static</span> <span class="signature-type">\Imagine\Image\BoxInterface</span> <strong><a href="yii-imagine-baseimage.html#getThumbnailBox()-detail">getThumbnailBox</a></strong> ( <span class="signature-type">\Imagine\Image\BoxInterface</span> <span style="color: #0000BB">$sourceBox</span>, <span style="color: #0000BB">$width</span>, <span style="color: #0000BB">$height</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$sourceBox</span></td>
                  <td class="param-type-col">\Imagine\Image\BoxInterface</td>
                  <td class="param-desc-col"><p>Original image box</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$width</span></td>
                  <td class="param-type-col">int</td>
                  <td class="param-desc-col"><p>Thumbnail width</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$height</span></td>
                  <td class="param-type-col">int</td>
                  <td class="param-desc-col"><p>Thumbnail height</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">\Imagine\Image\BoxInterface</td>
                  <td class="param-desc-col"><p>Thumbnail box</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="setImagine()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-imagine-baseimage.html#setImagine()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-imagine/edit/master/BaseImage.php#L89" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-imagine/blob/master/BaseImage.php#L89" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        setImagine()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong></strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type">void</span> <strong><a href="yii-imagine-baseimage.html#setImagine()-detail">setImagine</a></strong> ( <span style="color: #0000BB">$imagine</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$imagine</span></td>
                  <td class="param-type-col">\Imagine\Image\ImagineInterface</td>
                  <td class="param-desc-col"><p>The <code>Imagine</code> object.</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="text()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-imagine-baseimage.html#text()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-imagine/edit/master/BaseImage.php#L247" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-imagine/blob/master/BaseImage.php#L247" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        text()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Draws a text string on an existing image.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type">\Imagine\Image\ImageInterface</span> <strong><a href="yii-imagine-baseimage.html#text()-detail">text</a></strong> ( <span style="color: #0000BB">$filename</span>, <span style="color: #0000BB">$text</span>, <span style="color: #0000BB">$fontFile</span>, <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <span style="color: #0000BB">$start&nbsp;</span><span style="color: #007700">=&nbsp;[</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">]</span>, <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <span style="color: #0000BB">$fontOptions&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$filename</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The image file path or path alias.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$text</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The text to write to the image</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$fontFile</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The file path or path alias</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$start</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The starting position of the text. This must be an array with two elements representing <code>x</code> and <code>y</code> coordinates.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$fontOptions</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The font options. The following options may be specified:</p>
<ul>
<li>color: The font color. Defaults to "fff".</li>
<li>size: The font size. Defaults to 12.</li>
<li>angle: The angle to use to write the text. Defaults to 0.</li>
</ul>
</td>
                </tr>
                                                    <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidparamexception.html">yii\base\InvalidParamException</a></td>
                  <td class="param-desc-col"><p>if <code>$fontOptions</code> is invalid</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="thumbnail()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-imagine-baseimage.html#thumbnail()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-imagine/edit/master/BaseImage.php#L180" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-imagine/blob/master/BaseImage.php#L180" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        thumbnail()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Creates a thumbnail image.</strong></p>

        <p>If one of thumbnail dimensions is set to <code>null</code>, another one is calculated automatically based on aspect ratio of
original image. Note that calculated thumbnail dimension may vary depending on the source image in this case.</p>
<p>If both dimensions are specified, resulting thumbnail would be exactly the width and height specified. How it's
achieved depends on the mode.</p>
<p>If <code>ImageInterface::THUMBNAIL_OUTBOUND</code> mode is used, which is default, then the thumbnail is scaled so that
its smallest side equals the length of the corresponding side in the original image. Any excess outside of
the scaled thumbnail’s area will be cropped, and the returned thumbnail will have the exact width and height
specified.</p>
<p>If thumbnail mode is <code>ImageInterface::THUMBNAIL_INSET</code>, the original image is scaled down so it is fully
contained within the thumbnail dimensions. The rest is filled with background that could be configured via
<a href="yii-imagine-baseimage.html#$thumbnailBackgroundColor-detail">yii\imagine\Image::$thumbnailBackgroundColor</a> and <a href="yii-imagine-baseimage.html#$thumbnailBackgroundAlpha-detail">yii\imagine\Image::$thumbnailBackgroundAlpha</a>.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type">\Imagine\Image\ImageInterface</span> <strong><a href="yii-imagine-baseimage.html#thumbnail()-detail">thumbnail</a></strong> ( <span style="color: #0000BB">$filename</span>, <span style="color: #0000BB">$width</span>, <span style="color: #0000BB">$height</span>, <span style="color: #0000BB">$mode&nbsp;</span><span style="color: #007700">=&nbsp;\</span><span style="color: #0000BB">Imagine</span><span style="color: #007700">\</span><span style="color: #0000BB">Image</span><span style="color: #007700">\</span><span style="color: #0000BB">ManipulatorInterface</span><span style="color: #007700">::</span><span style="color: #0000BB">THUMBNAIL_OUTBOUND</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$filename</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The image file path or path alias.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$width</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>The width in pixels to create the thumbnail</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$height</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a></td>
                  <td class="param-desc-col"><p>The height in pixels to create the thumbnail</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$mode</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Mode of resizing original image to use in case both width and height specified</p>
</td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="watermark()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-imagine-baseimage.html#watermark()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-imagine/edit/master/BaseImage.php#L219" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-imagine/blob/master/BaseImage.php#L219" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        watermark()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Adds a watermark to an existing image.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type">\Imagine\Image\ImageInterface</span> <strong><a href="yii-imagine-baseimage.html#watermark()-detail">watermark</a></strong> ( <span style="color: #0000BB">$filename</span>, <span style="color: #0000BB">$watermarkFilename</span>, <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <span style="color: #0000BB">$start&nbsp;</span><span style="color: #007700">=&nbsp;[</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$filename</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The image file path or path alias.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$watermarkFilename</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>The file path or path alias of the watermark image.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$start</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>The starting point. This must be an array with two elements representing <code>x</code> and <code>y</code> coordinates.</p>
</td>
                </tr>
                                                    <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidparamexception.html">yii\base\InvalidParamException</a></td>
                  <td class="param-desc-col"><p>if <code>$start</code> is invalid</p>
</td>
                </tr>
                        </table>

<!--	-->
</div>
        </div>
</div>

<script type="text/javascript">
    /*<![CDATA[*/
    $("a.toggle").on('click', function () {
        var $this = $(this);
        if ($this.hasClass('properties-hidden')) {
            $this.text($this.text().replace(/Show/,'Hide'));
            $this.parents(".summary").find(".inherited").show();
            $this.removeClass('properties-hidden');
        } else {
            $this.text($this.text().replace(/Hide/,'Show'));
            $this.parents(".summary").find(".inherited").hide();
            $this.addClass('properties-hidden');
        }

        return false;
    });
    /*
     $(".sourceCode a.show").toggle(function () {
     $(this).text($(this).text().replace(/show/,'hide'));
     $(this).parents(".sourceCode").find("div.code").show();
     },function () {
     $(this).text($(this).text().replace(/hide/,'show'));
     $(this).parents(".sourceCode").find("div.code").hide();
     });
     $("a.sourceLink").click(function () {
     $(this).attr('target','_blank');
     });
     */
    /*]]>*/
</script>


</div>

<footer class="footer">
        <p class="pull-right"><small>Page generated on Sat, 09 Jul 2016 12:15:51 +0000</small></p>
    Powered by <a href="http://www.yiiframework.com/" rel="external">Yii Framework</a></footer>

<script type="text/javascript">jQuery(document).ready(function () {
    var shiftWindow = function () { scrollBy(0, -50) };
    if (location.hash) setTimeout(shiftWindow, 1);
    window.addEventListener("hashchange", shiftWindow);
var element = document.createElement("script");
element.src = "./jssearch.index.js";
document.body.appendChild(element);

var searchBox = $('#searchbox');

// search when typing in search field
searchBox.on("keyup", function(event) {
    var query = $(this).val();

    if (query == '' || event.which == 27) {
        $('#search-resultbox').hide();
        return;
    } else if (event.which == 13) {
        var selectedLink = $('#search-resultbox a.selected');
        if (selectedLink.length != 0) {
            document.location = selectedLink.attr('href');
            return;
        }
    } else if (event.which == 38 || event.which == 40) {
        $('#search-resultbox').show();

        var selected = $('#search-resultbox a.selected');
        if (selected.length == 0) {
            $('#search-results').find('a').first().addClass('selected');
        } else {
            var next;
            if (event.which == 40) {
                next = selected.parent().next().find('a').first();
            } else {
                next = selected.parent().prev().find('a').first();
            }
            if (next.length != 0) {
                var resultbox = $('#search-results');
                var position = next.position();

//              TODO scrolling is buggy and jumps around
//                resultbox.scrollTop(Math.floor(position.top));
//                console.log(position.top);

                selected.removeClass('selected');
                next.addClass('selected');
            }
        }

        return;
    }
    $('#search-resultbox').show();
    $('#search-results').html('<li><span class="no-results">No results</span></li>');

    var result = jssearch.search(query);

    if (result.length > 0) {
        var i = 0;
        var resHtml = '';

        for (var key in result) {
            if (i++ > 20) {
                break;
            }
            resHtml = resHtml +
            '<li><a href="' + result[key].file.u.substr(3) +'"><span class="title">' + result[key].file.t + '</span>' +
            '<span class="description">' + result[key].file.d + '</span></a></li>';
        }
        $('#search-results').html(resHtml);
    }
});

// hide the search results on ESC
$(document).on("keyup", function(event) { if (event.which == 27) { $('#search-resultbox').hide(); } });
// hide search results on click to document
$(document).bind('click', function (e) { $('#search-resultbox').hide(); });
// except the following:
searchBox.bind('click', function(e) { e.stopPropagation(); });
$('#search-resultbox').bind('click', function(e) { e.stopPropagation(); });

});</script></body>
</html>
